gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 13:42:47 25 4
gpt4 key购买 nike

官方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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com