java - ResourceBundleControlProvider 在 Java 中实际上已被弃用吗?

标签 java java-8 deprecated resourcebundle

官方Oracle documentation对于 ResourceBundleControlProvider 说:

Provider implementations must be packaged using the Java Extension Mechanism as installed extensions. ...

Since: 1.8

但是,当您单击提到的 Java Extension Mechanism 时链接,上面写着:

This feature has been deprecated and will be removed in a future release.

这是否意味着 Java 1.8 中引入的 ResourceBundleControlProvider 接口(interface)已被弃用?我们要开始使用它吗?为什么会在那里?

看起来它被错误地引入了Java 8,如 Deprecate ResourceBundleControlProvider for removal打开 JDK 错误提示:

This interface was introduced in JDK 8 (JDK-6380549) for a convenient way to replace the default Control with the provided one, using the Java Extension Mechanism, which is now obsolete in JDK 9. The original requestor of this feature confirms that they haven't used this API. It turned out that to our knowledge, there seem to be no users of this interface. Adding @Deprecated tag with forRemoval=true in JDK 9, and removing the interface in JDK 10 may be appropriate.

这个界面看起来像是一个胎死腹中的功能,它的使用方式是如此奇怪和不切实际。

最佳答案

看起来该功能确实将在 JDK 9 中被弃用,至少如果 http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/760e51207cb0 中的代码是如此。将成为 Java 9 版本的一部分:

* @deprecated There is no longer any mechanism to install a custom
* {@code ResourceBundleControlProvider} implementation defined
* by the platform class loader or its ancestor. The recommended
* way to use a custom {@code Control} implementation to load resource bundle
* is to use {@link java.util.ResourceBundle#getBundle(String, Control)}
* or other factory methods that take custom {@link java.util.ResourceBundle.Control}.
*/
@Deprecated(since="9", forRemoval=true)
public interface ResourceBundleControlProvider {

关于java - ResourceBundleControlProvider 在 Java 中实际上已被弃用吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42643102/

相关文章:

java - 是否可以在 Spring 中取消声明或定义 null bean?

java - Android 检查每个 Activity 的网络状态(连续)

java - 当键是字符串时如何在 Java 中创建范围映射

php - 用户测试中多个客户端的 Symfony 4.4 弃用警告已弃用,仍存在于文档中

java - Jackson 将 Map 合并到 json 对象中

java - Payara 5 web.xml 中 PGSimpleDataSource 的自定义属性

java - 您可以使用 Java 8 编译一个类,然后在 Java 7 中使用它吗?

Java "Interface"类

android - install_referrer Intent 弃用和更新库

PHP - mysql_prep 已弃用