简体   繁体   English

未记录的热点 OpenJDK 系统属性

[英]Undocumented Hotspot OpenJDK System properties

I've recently discovered some undocumented system properties in the JDK's System.Logger API , in particular, jdk.logger.finder.singleton .我最近在 JDK 的System.Logger API中发现了一些未记录的系统属性,特别是jdk.logger.finder.singleton I couldn't find any web pages which mention this system property or any property at all relating to the System.Logger API.我找不到任何提及此系统属性或任何与 System.Logger API 相关的属性的 web 页面。 Nor is it mentioned in the System.LoggerFinder javadoc . System.LoggerFinder javadoc中也没有提到它。

The lack of information on these properties raises several questions:缺乏这些属性的信息引发了几个问题:

  • Is it acceptable, supported, or intended for application developers to use these properties?应用程序开发人员是否可以接受、支持或打算使用这些属性?
  • Why do the JDK developers leave undocumented properties in the openjdk implementation?为什么 JDK 开发人员在 openjdk 实现中留下未记录的属性?

It reminds me of the file.encoding property, which I read is not a "supported mechanism."它让我想起了file.encoding属性,我读到它不是“支持的机制”。

Is it acceptable, supported, or intended for application developers to use these properties?应用程序开发人员是否可以接受、支持或打算使用这些属性?

No, unless it's properly documented in public API, developers shouldn't use it.不,除非它在公共 API 中正确记录,否则开发人员不应使用它。 Different JVM/JRE implementation will most likely not support them, which will limit your target platform不同的 JVM/JRE 实现很可能不支持它们,这将限制您的目标平台

Why do the JDK developers leave undocumented properties in the openjdk implementation为什么JDK开发人员在openjdk实现中留下未记录的属性

Because it is implementation detail and might be subject to change.因为它是实现细节,可能会发生变化。 Once made public, it's hard to make change without affecting consumers of this code.一旦公开,很难在不影响此代码的使用者的情况下进行更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM