This repository has been archived by the owner on Jan 14, 2018. It is now read-only.
spicemanager: always use isStarted() when checking if started. #214
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In my
SpiceManager
subclass, I overridestart(Context)
and check if the manager is started to avoid receiving anIllegalStateException
:However, there was a case where a user of my robospice 1.4.7-based application received exactly this:
Since
SpiceManager.start()
checks the value ofrunner
instead of usingisStarted()
, it seems that in rare occasions the former may not benull
while the latter isfalse
. So, I changed the check to useisStarted()
.I believe this is within the "spirit" of the library, since this is the only place where the value of
runner
is checked. Everywhere else the check is done using eitherisStopped
orisStarted()
. I have also run all the tests and none fails. However, I do not know why this occurs and what it means to create a newrunner
while the existing is notnull
.