Skip to content
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

Issue 251. Pulled bindPlayServices() out of constructor and into separate initialize() method #252

Merged

Conversation

autonomousapps
Copy link
Collaborator

Code is self-explanatory, but breaking for current users.

Rationale:
Sometimes, bindPlayServices() finishes its asynchronous work before the constructor finishes. This can mean that onBillingInitialized() is called before the constructor finishes, and so work involving a billingProcessor can result in NPEs.

@serggl
Copy link
Member

serggl commented Mar 30, 2017

@autonomousapps this should be done as an alternative constructor option I guess

@autonomousapps
Copy link
Collaborator Author

Ah, that's a good idea. How do you feel about static factory constructors? Or would you prefer another constructor with, say, a boolean parameter?

@autonomousapps
Copy link
Collaborator Author

I've updated my PR to add overloaded constructors and factory methods so that this change will be non-breaking to current library users.

@serggl
Copy link
Member

serggl commented Mar 31, 2017

@autonomousapps this now looks good. Can you please update README with new factory method description/instructions ?

@autonomousapps
Copy link
Collaborator Author

Absolutely. I'll have it updated today.

I see the build failed with:

Checkstyle rule violations were found. See the report at: file:///home/travis/build/anjlab/android-inapp-billing-v3/library/build/reports/checkstyle/checkstyle.html

I haven't used TravisCI, so I'm not sure how to see the style failures. Could you tell me if they're my new code and how I can address them?

@autonomousapps autonomousapps force-pushed the issue251-initialize-outside-constructor branch from 0a06768 to dbd9399 Compare March 31, 2017 19:03
@autonomousapps
Copy link
Collaborator Author

Updated PR and squashed into one commit.

@serggl
Copy link
Member

serggl commented Apr 1, 2017

@autonomousapps sorry my fault. I should probably update readme with a checkstyle requirements.

Basically you need to ensure that ./gradlew checkstyle does not show any errors/warnings.

And ready to merge this PR once you will pass checkstyle. Thank you!

…of play services.

New initialize() method calls bindPlayServices().

Updated README.md.
@autonomousapps autonomousapps force-pushed the issue251-initialize-outside-constructor branch from dbd9399 to d68d66e Compare April 2, 2017 16:42
@autonomousapps
Copy link
Collaborator Author

I've amended my commit and force-pushed. Fixes all checkstyle issues.

@serggl serggl merged commit 134d925 into anjlab:master Apr 3, 2017
serggl added a commit that referenced this pull request Apr 3, 2017
@autonomousapps autonomousapps deleted the issue251-initialize-outside-constructor branch April 5, 2017 17:19
showdpro pushed a commit to showdpro/android-inapp-billing-v3 that referenced this pull request Jul 13, 2021
…of play services. (anjlab#252)

New initialize() method calls bindPlayServices().

Updated README.md.
showdpro pushed a commit to showdpro/android-inapp-billing-v3 that referenced this pull request Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants