-
Notifications
You must be signed in to change notification settings - Fork 37
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
[Nullability Annotations to Java Classes] Add Missing Nullability Annotations to Media
Network Client Classes (safe
)
#2878
[Nullability Annotations to Java Classes] Add Missing Nullability Annotations to Media
Network Client Classes (safe
)
#2878
Conversation
Warning: "Field 'mOkHttpClient' may be 'final'"
Warning: "Field 'mMediaResponseUtils' may be 'final'"
Warning: "Field 'mCurrentUploadCalls' may be 'final'"
Warning: "Raw use of parameterized class 'WPComGsonRequest'"
Warning: "Link specified as plain text"
Warning: "Condition 'response == null' covered by subsequent condition '!(response instanceof Boolean)'"
Warning: "Link specified as plain text"
Warning: “Exception ‘java.io.IOException’ is never thrown in the method”
Warnings: - "Raw use of parameterized class 'Map'" - "Raw use of parameterized class 'HashMap'"
Warning: "StandardCharsets.UTF_8 can be used instead"
Warning: "'if' statement can be simplified"
FYI: 'nn-a' stands for 'non-null annotation'.
FYI: 'nn-a' stands for 'non-null annotation'.
FYI: 'nn-a' stands for 'non-null annotation'.
FYI: 'n-a' stands for 'nullability annotations'.
FYI: 'n-a' stands for 'nullability annotations'.
FYI: 'n-a' stands for 'nullability annotations'.
FYI: 'n-a' stands for 'nullability annotations'.
FYI: 'n-a' stands for 'nullability annotations'
FYI: 'n-a' stands for 'nullability annotations'
FYI: 'n-a' stands for 'nullability annotations'
FYI: 'n-a' stands for 'nullability annotations'
FYI: 'n-a' stands for 'nullability annotations'
Warnings: - "Blank line will be ignored" - "Link specified as plain text"
FYI: 'n-a' stands for 'nullability annotations'
Warnings: - "Blank line will be ignored" - "Link specified as plain text"
Warnings: - "Inner class 'MultipleMediaResponse' may be 'static'" - "Inner class 'Thumbnails' may be 'static'"
FYI: 'nl-a' stands for 'nullable annotation'.
FYI: 'nn-a' stands for 'non-null annotations'. PS: This 'NotNullFieldNotInitialized' warning got suppressed because a 'response' class can never have its fields initialized via a constructor initialization, or otherwise for that matter. ------------------------------------------------------------------------ Also, note that as part of this change, the 'response' that was previously considered '@nullable' has been updated to '@nonnull' as it doesn't seem that a nullable response to be valid, or part of a specific valid flow. The fact that 'MediaWPRESTResponse.kt' and 'BaseWPV2MediaRestClient.kt' is also working with a '@nonnull' response give this change some extra confidence.
FYI: 'n-a' stands for 'nullability annotations'.
…ndroid into analysis/add-missing-nullability-annotations-to-media-client-classes
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.
Hey @ParaskP7
I looked at this PR’s code changes and smoke-tested the companion WP PR. Everything looks good to me 👍🏼
I am approving but not merging since this change affects WC. I am unsure whether we should also wait until someone from WC approves this change.
Please feel free to merge this PR at your convenience
Great, thanks for reviewing and testing this @AjeshRPai , I am glad that everything is working as expected! 🙇 ❤️ 🚀 FYI: @0nko I'll be also waiting any input from you, else a quick 👍 , that is before proceeding with merging this, just so that I know you are aware of this change merging into |
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.
I briefly scanned the code and I see no issue with it. I'm currently having some issues with my build environment so I can't test it unfortunately. But since @AjeshRPai already smoke-tested it, I think we should be fine. Thanks for working on this @ParaskP7 and sorry about the wait.
Great, thanks you so much for the skim review @0nko , much appreciated! 🙇 ❤️
Let me know if I can help with your build environment as it would be actually great if you could test this with WCAndroid as well. FYI: To my understanding, Ajesh tested this only with JP/WPAndroid. 🙏 |
@ParaskP7 I've smoke-tested the app and everything works as expected! |
Awesome, thanks so much for getting back to this with some additional testing @0nko , you rock! 🙇 ❤️ 🚀 |
Parent #2798
Accompanying JP/WPAndroid#19428
This PR adds any missing nullability annotation to MediaRestClient.java and MediaXMLRPCClient.java, all its related response classes and anything in between (ie.
MediaStore
). See response classes below:FYI.1: This change is
safe
, meaning that there shouldn't be any (major) compile-time changes associated with this change. Having said that, testing is highly recommended since the changes in this PR can affect one or more clients (ie. JP/WPAndroid, WCAndroid, etc)FYI.2: An analysis on
MediaStore
and their usages with our main clients suggests that this store is being utilizing by both, the JP/WPAndroid and WCAndroid clients.PS.1: @AjeshRPai I added you as the main reviewer, randomly so, since I just wanted someone from the Jetpack/WordPress mobile team to be aware of and sign-off on that change for both. Feel free to merge this PR directly yourself if you deem so.
PS.2: @0nko I am also adding you as an extra reviewer, randomly so, since I want someone from the WooCommerce mobile team to be aware of this change as well. However, there is no need for you to review it as well, thus duplicating the review work. Having one team member from either of the mobile teams reviewing and testing this change is enough for this change.
Nullability Annotation List:
Nullability Checks List:
Warnings Resolutions List:
Warnings Suppression List:
Refactor List:
Test List:
<p>
on ms upload store testDocs List:
Associated Clients
It is highly recommending that this change is being tested on the below associated clients:
To Test (
REST
):FluxC Example
app via theMEDIA
screen. Verify everything is working as expected.To Test (
XMLRPC
):FluxC Example
app via theMEDIA
screen. Verify everything is working as expected.[JP/WP] Media Screens [MediaBrowserActivity.java + MediaGridFragment.kt + MediaSettingsActivity.java + MediaPreviewActivity.java + MediaPreviewFragment.java]
ℹ️ This test applies to both, the
Jetpack
andWordPress
app.Media
screen, verify it is shown and functioning as expected.Media Settings
screen is shown and functioning as expected.Media Preview
screen is shown and functioning as expected.[WC] Photos Screens [ProductDetailFragment.java + ProductImagesFragment.kt + ProductImageViewerFragment.kt]
Products
tab and tap on any product.Photos
screen is shown and functioning as expected.Photo Preview
screen is shown and functioning as expected.Merge instructions:
[PR] Not Ready for Merge
label.