TeamAmaze / TeamAmaze/AmazeFileManager
Enhance readablity by making objects that could live longer than it's activity their own name
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 6.4k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 1
Description
When dealing with AsyncTasks or Task<V, Callable<V>> never create it anonimously:
new AsyncTask<Void, Void, Float>() {
//...
};
as it may cause the programmer to easily forget that all variables used and an instance of this are strongly referenced for the life of the anonymous object. That could cause unforeseen leaks.
A mitigation is having each object be instantiated from a subclass:
new MakeThingTask(...);
This is more explicit in its "aquisition" of strong references to the parameters passed.
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 by searching the Android project for anonymous AsyncTask and Task<V, Callable> usages. Determine which objects need named subclasses to make their strong references explicit, and consider the work complete when the affected usages follow that pattern without introducing the described leak risk.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100