-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[in_app_purchase] Fix Java lints #4032
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
Conversation
Removes lint-baseline.xml, fixing all resulting warnings. Also makes some fixes that weren't flagged by the command-line lint, but were flagged by Android Studio's linter, to reduce the noise in the UI. This includes all of the conversions of anonymous subclasses to lambdas, which were entirely tool-generated. Part of flutter/flutter#88011
|
|
||
| @Override | ||
| public void onMethodCall(MethodCall call, MethodChannel.Result result) { | ||
| public void onMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result result) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like some of the unit tests are failing with an IllegalArgumentException on calls to onMethodCall.
I've had some difficulties getting the these tests to run locally, but given that the only change was to add @nonnull I'm assuming that some of the tests were passing in null somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm the tests are definitely not passing in null. I've confirmed that the tests succeed on the commit before this one and not on this one, but I'm somewhat at a loss as to what in these changes could cause this error:
Please provide Old SKU purchase information(token/id) or original external transaction id, not both.
java.lang.IllegalArgumentException: Please provide Old SKU purchase information(token/id) or original external transaction id, not both.
at com.android.billingclient.api.BillingFlowParams$SubscriptionUpdateParams$Builder.build(com.android.billingclient:billing@@5.2.0:7)
at com.android.billingclient.api.BillingFlowParams$Builder.build(com.android.billingclient:billing@@5.2.0:42)
at io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.launchBillingFlow(MethodCallHandlerImpl.java:331)
at io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.java:150)
at io.flutter.plugins.inapppurchase.MethodCallHandlerTest.launchBillingFlow_null_AccountId_do_not_crash(MethodCallHandlerTest.java:292)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out it was the removal of TextUtils.java; AS thought it was unused, but apparently that's not true. I thought since the test compiled we no longer needed it (what I had found about that file was discussion of adding it to prevent exceptions when calling isEmpty in unit tests), but apparently the implementation used in tests was just always returning false? That would explain the observed behavior, even though it seems crazy.
|
auto label is removed for flutter/packages, pr: 4032, due to This PR has not met approval requirements for merging. You are a member of flutter-hackers and need 1 more review(s) in order to merge this PR.
|
|
Oops, I forget this hadn't actually been LGTM 😬 auto-submit bot for the win! |
gmackall
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I forget this hadn't actually been LGTM 😬 auto-submit bot for the win!
Was actually right about to approve, LGTM!
flutter/packages@d449a17...fba97fa 2023-05-24 [email protected] Update infra reviewers and add label. (flutter/packages#4068) 2023-05-23 [email protected] [in_app_purchase] Bump `in_app_purchase_android` dependency to 3.0.0 (flutter/packages#4065) 2023-05-23 [email protected] [in_app_purchase] Fix Java lints (flutter/packages#4032) 2023-05-23 [email protected] Roll Flutter from 3437189 to f86c529 (22 revisions) (flutter/packages#4066) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/packages@d449a17...fba97fa 2023-05-24 [email protected] Update infra reviewers and add label. (flutter/packages#4068) 2023-05-23 [email protected] [in_app_purchase] Bump `in_app_purchase_android` dependency to 3.0.0 (flutter/packages#4065) 2023-05-23 [email protected] [in_app_purchase] Fix Java lints (flutter/packages#4032) 2023-05-23 [email protected] Roll Flutter from 3437189 to f86c529 (22 revisions) (flutter/packages#4066) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Removes lint-baseline.xml, fixing all resulting warnings.
Also makes some fixes that weren't flagged by the command-line lint, but were flagged by Android Studio's linter, to reduce the noise in the UI. This includes all of the conversions of anonymous subclasses to lambdas, which were entirely tool-generated.
Part of flutter/flutter#88011
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style.///).