IndexOutOfBoundsException in getSectionTitle of CountryCodeAdapter
还没有人认领这个 Issue。
评估
调研方向
先阅读 CountryCodeAdapter.java,尤其是 getSectionTitle 以及第 202 行附近对 filteredCountries 的访问,然后检查 FastScroller.java 如何提供位置。如果可能,请复现崩溃,并验证超出范围的位置不再抛出 IndexOutOfBoundsException,同时有效的国家分区仍会返回其标题。
由索引模型根据 Issue 内容生成。
描述
Fatal Exception: java.lang.IndexOutOfBoundsException
Index: 253, Size: 253
java.util.ArrayList.get (ArrayList.java:437)
com.hbb20.CountryCodeAdapter.getSectionTitle (CountryCodeAdapter.java:1)
Sometimes FastScroller.java crashes app. It will be better to check the length of filteredCountries before get CCPCountry in this line
CCPCountry ccpCountry = filteredCountries.get(position); (202 line of CountryCodeAdapter class)
For example like this:
public String getSectionTitle(int position) {
if (preferredCountriesCount > position) {
return "★";
} else if (filteredCountries.size() > position) {
return filteredCountries.get(position).getName().substring(0, 1);
} else {
return ""; //this should never be the case but it does
}
}
- 主要语言
- Java
- 星标
- 1.5k
- 派生
- 509
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
hbb20/CountryCodePickerProject 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 62/100
-
Jeux未关闭
难度 5/5 一周以上 新手友好度 10/100
-
难度 3/5 1-2 天 新手友好度 45/100
hbb20/CountryCodePickerProject#624 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
-
Font change未关闭
难度 3/5 1-2 天 新手友好度 40/100
查看 hbb20/CountryCodePickerProject 的全部 Issue
相似的 Issue
-
Flight SQL JDBC parses boolean properties case-sensitively, silently disabling TLS for useEncryption=TRUE可能已有人在做 @Arawoof06 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 79/100
apache/arrow-java#1357 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
apache/rocketmq-dashboard#6610 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
MetricsHub/metricshub-community#1396 ·
维护者通常 1 天内回复
-
L: java:gradle L: java:maven L: ruby:bundler T: bug 🐞
难度 2/5 1-3 小时 新手友好度 76/100
dependabot/dependabot-core#16547 ·
维护者通常 1 天内回复
-
Citationcount column sorts alphabetically instead of numerically可能已有人在做 @kpunia306 今天认领。 未关闭status: needs-triage
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复