bluelinelabs / bluelinelabs/Conductor
Change ensureRequiredConstructor() to "protected"
- Dominant language
- Java
- Stars
- 3.9k
- Forks
- 338
- PR merge metrics
- No merged PRs in 30d
Description
Quite often I don't want my apps to restore their last controller hierarchy after being killed on process death. Usually because I think the user wants to start fresh anyways and doesn't know where he left hours before.
I do this by calling `Conductor.attachRouter(this, rootContainer, **null**)` whenever I detect process death. Of course, instance state is saved anyways but I just ignore it on next start. So far so good.
Unfortunately, Conductor is not aware of this and still forces my controllers to have a default and a bundle constructor which I don't need/want in my case because my controllers do not need to be restored. The first enforcement is done by conductor-lint which I can luckily circumvent by having the two required constructors as protected in my BaseController. Okay.
The second and only thing left is that on creation of each controller `ensureRequiredConstructor()` is called at runtime and checks my controllers for these two constructors. If this method would be protected instead of private I could also override it in my BaseController which is aware of how I "configured" conductor and therefore can prevent these checks.
**Is there any chance that ensureRequiredConstructor() can be changed to "protected"?**
Or do you even plan to provide other options to configure conductor the way I want?
Contributor guide
Research direction
Start by locating ensureRequiredConstructor() and the controller-construction path that calls it. Review how the default and bundle constructors are validated, then determine whether protected visibility or another configuration path fits the reported process-death use case. Done means the requested behavior is supported and the constructor checks remain covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100