IndexOutOfBoundsException in getSectionTitle of CountryCodeAdapter
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 48/100
Research direction
Start by reading CountryCodeAdapter.java, especially getSectionTitle and the filteredCountries access around line 202, then inspect how FastScroller.java supplies positions. Reproduce the crash if possible and verify that out-of-range positions no longer throw an IndexOutOfBoundsException while valid country sections still return their titles.
Written by the indexing model from the issue text.
Description
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
}
}
- Dominant language
- Java
- Stars
- 1.5k
- Forks
- 509
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hbb20/CountryCodePickerProject
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
-
Jeux Open
Difficulty 5/5 Over a week Newbie friendliness 10/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
hbb20/CountryCodePickerProject#624 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Font change Open
Difficulty 3/5 1-2 days Newbie friendliness 40/100
All issues in hbb20/CountryCodePickerProject
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
HL7/fhir-ig-publisher#1375 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Flaky: a relaunched catch-up replay can still report catching up right after its marker is written Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
johanhaleby/occurrent#1134 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
objectionary/jeo-maven-plugin#1811 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100