One aspect that I consider javac will not cover if you cannot modify third-party code to add @Deprecated annotations. If you just want to avoid a method that was not marked as deprecated, you can use this plugin that I wrote for FindBugs:
https://github.com/Grundlefleck/FindBugs4Deprecating3rdParty
There is very little documentation, so you may need to study yourself a little. This avoids settings and classes in the properties file. I use it to refuse org.junit.Assert.assertThat .
source share