When are API methods marked “deprecated” actually going to go away?

Regarding the APIs, … it is not specified they will be removed anytime soon.

Incompatibilities in J2SE 5.0 (since 1.4.2):

Source Compatibility

[…]
In general, the policy is as follows, except for any incompatibilities listed further below:

Deprecated APIs are interfaces that are supported only for backwards compatibility. The javac compiler generates a warning message whenever one of these is used, unless the -nowarn command-line option is used. It is recommended that programs be modified to eliminate the use of deprecated APIs, though there are no current plans to remove such APIs – with the exception of JVMDI and JVMPI – entirely from the system.

Even in its How and When To Deprecate APIs, nothing is being said about a policy regarding actually removing the deprected APIs…


Update 10 years later, the new JDK9+ Enhanced Deprecation clarifies the depreciation policy.
See Jens Bannmann‘s answer for more details.
This is also detailed in this blog post by Vojtěch Růžička, following criticisms on JEP 277.

The convention for JDK is that once a JDK API is marked as forRemoval=true in a certain Java version, it will be removed in the directly following major Java release.
That means – when something is marked as forRemoval=true in Java 9, it is supposed to be completely removed in Java 10.
Keep that in mind when using API marked for removal.

Note that this convention applies only to JDK itself and third-party libraries are free to choose any convention they see fit.

Leave a Comment