scwang90 / SmartRefreshLayout

🔥下拉刷新、上拉加载、二级刷新、淘宝二楼、RefreshLayout、OverScroll,Android智能下拉刷新框架,支持越界回弹、越界拖动,具有极强的扩展性,集成了几十种炫酷的Header和 Footer。
https://segmentfault.com/a/1190000010066071
Apache License 2.0
24.95k stars 4.96k forks source link

当场递归死循环, java.lang.StackOverflowError #1579

Closed Mingyueyixi closed 1 day ago

Mingyueyixi commented 3 months ago

版本:2.1.0 调用代码:mRefreshLayout.setNoMoreData(true); 或 mRefreshLayout.finishLoadMoreWithNoMoreData(); 无其他操作,当场递归直到爆炸。

Process: com.hehe.test, PID: 6028 java.lang.StackOverflowError: stack size 8MB at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) 2024-08-02 17:01:30.523 6028-6028 AndroidRuntime com.hehe.test E at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) 2024-08-02 17:01:30.713 6028-6028 AndroidRuntime com.hehe.test E at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) 2024-08-02 17:01:30.713 6028-6028 AndroidRuntime com.hehe.test E at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.scwang.smart.refresh.layout.SmartRefreshLayout$6.run(SmartRefreshLayout.java:3042) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefresh(SmartRefreshLayout.java:3091) at com.scwang.smart.refresh.layout.SmartRefreshLayout.finishRefreshWithNoMoreData(SmartRefreshLayout.java:3104) at com.scwang.smart.refresh.layout.SmartRefreshLayout.setNoMoreData(SmartRefreshLayout.java:2903) at com.hehe.test.ui.mine.MyInListFragment.onGetInList(MyInListFragment.java:260)

kokobebekoko commented 3 months ago

我也遇到这个问题了

acomet commented 3 months ago

我擦,新鲜出炉,我也遇到这个问题了,我是切换主题之后才出现的

Mingyueyixi commented 3 months ago

我擦,新鲜出炉,我也遇到这个问题了,我是切换主题之后才出现的

我都不需要什么操作,调一下没有更多数据就当场递归了。一看源马,的确是有递归的。

acomet commented 3 months ago

我擦,新鲜出炉,我也遇到这个问题了,我是切换主题之后才出现的

我都不需要什么操作,调一下没有更多数据就当场递归了。一看源马,的确是有递归的。

我这边是调用showEmpty()方法引起的(这个方法里面最终也会调用setNoMoreData())。 奇怪的是,我项目里大量使用了showEmpty(),但每次StackOverflowError都精准发生在同一个类,研究了大半天也看不出这个类有什么不一样。因为我项目里还使用了另外一个框架com.github.liangjingkanji:BRV, 所以暂时使用com.drake.statelayout.StateLayout的showEmpty()替代com.drake.brv.PageRefreshLayout的showEmpty()

Mingyueyixi commented 3 months ago

我擦,新鲜出炉,我也遇到这个问题了,我是切换主题之后才出现的

我都不需要什么操作,调一下没有更多数据就当场递归了。一看源马,的确是有递归的。

我这边是调用showEmpty()方法引起的(这个方法里面最终也会调用setNoMoreData())。 奇怪的是,我项目里大量使用了showEmpty(),但每次StackOverflowError都精准发生在同一个类,研究了大半天也看不出这个类有什么不一样。因为我项目里还使用了另外一个框架com.github.liangjingkanji:BRV, 所以暂时使用com.drake.statelayout.StateLayout的showEmpty()替代com.drake.brv.PageRefreshLayout的showEmpty()

不奇怪。我看了源马,没有更多数据这个方法就是存在递归隐窜的。我现在直接不用这功能了。

Mingyueyixi commented 3 months ago

我擦,新鲜出炉,我也遇到这个问题了,我是切换主题之后才出现的

我都不需要什么操作,调一下没有更多数据就当场递归了。一看源马,的确是有递归的。

我这边是调用showEmpty()方法引起的(这个方法里面最终也会调用setNoMoreData())。 奇怪的是,我项目里大量使用了showEmpty(),但每次StackOverflowError都精准发生在同一个类,研究了大半天也看不出这个类有什么不一样。因为我项目里还使用了另外一个框架com.github.liangjingkanji:BRV, 所以暂时使用com.drake.statelayout.StateLayout的showEmpty()替代com.drake.brv.PageRefreshLayout的showEmpty()

不奇怪。我看了源马,没有更多数据这个方法就是存在递归隐窜的。我现在直接不用这功能了。

布局xml不加头尾view,就必现。其他情况不知道是不是偶发

zhouzhuo810 commented 2 months ago

我也发现了,原因是我布局里忘记加footer了。

Mingyueyixi commented 2 months ago

我也发现了,原因是我布局里忘记加footer了。

是的,不加的话必现

scwang90 commented 1 day ago

新版本已经解决并发布