API方法何时标记为“已弃用”其实要走了? [英] When are API methods marked "deprecated" actually going to go away?
问题描述
关于API,...没有指定他们很快就会被删除。
源兼容性
[...]
一般来说,除了下面进一步列出的任何不兼容之外,策略如下:
不推荐使用的API是只支持向后兼容性的接口。除非使用-nowarn命令行选项,否则javac编译器将在其中一个使用时生成警告消息。建议对程序进行修改,以消除使用不推荐使用的API,虽然目前没有计划删除这样的API - 除了JVMDI和JVMPI - 完全来自系统。
即使在如何以及何时弃用API ,关于实际删除已删除的API ...
I'm code reviewing a change one of my co-workers just did, and he added a bunch of calls to Date.toMonth(), Date.toYear() and other deprecated Date methods. All these methods were deprecated in JDK 1.1, but he insists that it's ok to use them because they haven't gone away yet (we're using JDK 1.5) and I'm saying they might go away any day now and he should use Calendar methods. Has Sun actually said when these things are going away, or does "@deprecated" just mean you lose style points?
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...
这篇关于API方法何时标记为“已弃用”其实要走了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!