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

Update Javadoc for ShadowContentResolver about deprecation notices #8874

Open
hoisie opened this issue Feb 26, 2024 · 5 comments · May be fixed by #8879
Open

Update Javadoc for ShadowContentResolver about deprecation notices #8874

hoisie opened this issue Feb 26, 2024 · 5 comments · May be fixed by #8879
Assignees
Labels
help wanted starter issue Small/simple issues for new contributors

Comments

@hoisie
Copy link
Contributor

hoisie commented Feb 26, 2024

In ShadowContentResolver there are a lot of @Deprecated methods. However, there are no suggestions to what should be used instead. This has caused a lot of confusion. The Javadoc should be updated with better information.

The alternative to ShadowContentResolver is creating fake ContentProviders and registering them using Robolectric.setupContentProvider or ContentProviderController.

@hoisie hoisie added help wanted starter issue Small/simple issues for new contributors labels Feb 26, 2024
@shashankiitbhu
Copy link

Hi, I would like to work on this Issue @hoisie can you assign this to me, thanks

@utzcoz
Copy link
Member

utzcoz commented Feb 27, 2024

@shashankiitbhu I assign this task to you. Please prepare a PR for it. Thanks.

@shashankiitbhu
Copy link

@utzcoz sure

@shashankiitbhu
Copy link

HI @utzcoz , should all the @Deprecated method's javadoc be updated like this?(below code) or unique information should be added for each method

Screenshot 2024-02-27 at 11 12 33 AM

@hoisie
Copy link
Contributor Author

hoisie commented Feb 27, 2024

@shashankiitbhu yeah that is on the right track. Something like this could be better:

  /**
   * @deprecated This method affects all calls, and does not work with {@link
   *     android.content.ContentResolver#acquireContentProviderClient}. Instead, use
   *     {@link org.robolectric.Robolectric#setupContentProvider(Class, String)} to
   *     install a test-specific ContentProvider that can return any Cursor.
   */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted starter issue Small/simple issues for new contributors
Projects
None yet
3 participants