Does Android Studio's inspection feature contain some option to mark certain classes as deprecated?
I suppose that the inspection rules currently do not support parametrized inspections e.g. "Mark following classes as deprecated: _______" but is there another way to fix that?
I want to move away from class X (which is not under our control) and use class XExtended and would like to reliably ensure that in our codebase no-one uses X again. Since we do use inspections regularly, having an inspection which looks for certain classes mark them as warning or error would be very useful.
Search and replace is somewhat tedious and does not protect for new uses. I also cannot remove the library where X is located as it is part of the android sdk.
Edit: During refactoring we find all those old uses due to unit test failures but not everything is yet fully covered with tests, so there might be undetected issues.
It is possible. I managed to do it with Android Studio 3.1.1. I marked a WebView class as deprecated as follows:

Then whenever I try to use WebView it will display deprecated as follows:

Steps to deprecate:
Annotate class <Class> as @DeprecatedThrough out the project, this class will be deprecated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With