The first rule of using deprecated classes is to do not use deprecated classes. If you have to use such class then double check how to avoid such situation and find newer implementation of deprecated class (most of the time the new alternative solution is provided). But if you really forced to use deprecated class (e.g. 3rd-party library) then during class compilation (compileJava and compileTestJava Gradle tasks) you will get below warning:

Note: <path_to_your_class_where_deprecated_class_is_used>.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

I will show you few solutions how to disable this warning.

Continue reading “Use @Deprecated Java class without compilation warning”