TeamAmaze / TeamAmaze/AmazeFileManager
`IndexOutOfBoundsException` on `SearchRecyclerViewAdapter#getItem`
Open
Nobody has claimed this yet.
From-Email
Issue-Bug
- Dominant language
- Kotlin
- Stars
- 6.4k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 1
Description
Issue explanation (write below this line)
Exception
- App Name: Amaze Filhanterare
- Package: com.amaze.filemanager
- Version: 3.10
- User Action: UI Error
- Request: Application crash
- OS: Linux
motorola/sabahl_ge/sabahl:13/TLA33.105-285/105-285:user/release-keys 13 - 33 - Device: sabahl
- Model: moto e13
- Product: sabahl_ge
Crash log
java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 606
at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at
jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
at java.util.Objects.checkIndex(Objects.java:359)
at java.util.ArrayList.get(ArrayList.java:434)
at java.util.Collections$UnmodifiableList.get(Collections.java:1546)
at androidx.recyclerview.widget.ListAdapter.getItem(ListAdapter.java:150)
at
com.amaze.filemanager.adapters.SearchRecyclerViewAdapter.access$getItem(SearchRecyclerViewAdapter.kt:42)
at
com.amaze.filemanager.adapters.SearchRecyclerViewAdapter$ViewHolder._init_$lambda$0(SearchRecyclerViewAdapter.kt:110)
at
com.amaze.filemanager.adapters.SearchRecyclerViewAdapter$ViewHolder.$r8$lambda$c3lVn7Fz_u5KsSS4_yNMvIM958o(Unknown
Source:0)
at
com.amaze.filemanager.adapters.SearchRecyclerViewAdapter$ViewHolder$$ExternalSyntheticLambda0.onClick(Unknown
Source:4)
at android.view.View.performClick(View.java:7511)
at android.view.View.performClickInternal(View.java:7484)
at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
at android.view.View$PerformClick.run(View.java:29472)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:8046)
at java.lang.reflect.Method.invoke(Native Method)
at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:703)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)
Contributor guide
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.
Research direction
Start with the crash trace in SearchRecyclerViewAdapter.kt, especially lines 42 and 110, and inspect how the ViewHolder click handler obtains its item. Reproduce or trace the click path that produces index -1; done means the reported IndexOutOfBoundsException no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100