-
-
Notifications
You must be signed in to change notification settings - Fork 735
Do not initialize when parse is already initialized #640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not initialize when parse is already initialized #640
Conversation
Codecov Report
@@ Coverage Diff @@
## master #640 +/- ##
============================================
- Coverage 52.85% 52.84% -0.02%
Complexity 1675 1675
============================================
Files 131 131
Lines 10142 10145 +3
Branches 1408 1408
============================================
Hits 5361 5361
- Misses 4338 4340 +2
- Partials 443 444 +1
Continue to review full report at Codecov.
|
Are we positive that the error was not being throw intentionally there to prevent some other side effects of having it init twice? Side note: if you extend |
@Jawnnypoo I think the behavior is not changed because this PR is still not allowing parse to init more than once. |
Since this is an application/developer issue, maybe it’s better to do this in ParsePlugins is private, I think the exception might come useful when writing internal tests for the SDK (ensures everything is tear down correctly, you know where you’re failing etc). |
…t issue a warning" This reverts commit ddbc562.
Thanks @natario1 |
d7e8e68
to
fb6f78d
Compare
fb6f78d
to
d8485f8
Compare
If Parse is initialized in the application.
An IllegalStateException might be thrown when unit testing with Robolectric framework.
for example
MyApplication.java
SomeTest.java
Will get
IllegalStateException: ParsePlugins is already initialized
because of Robolectric setup application twice in the same testing session.I think it would be better not to throw an exception when init parse more than once, just issue a warning log and do nothing.
It does not seems to be Robolectric's issue.
robolectric/robolectric#595
robolectric/robolectric#1981
robolectric/robolectric#2456