如果我查看 NetBeans Javadoc 窗口中的 StrictMath.toRadians()
,则会看到顶部两行
java.lang.StrictMath
public static strictfp double toRadians(double angdeg)
这是有道理的,因为我使用的 JDK 已使用 strictfp
修饰符定义了 StrictMath.toRadians()
。但是,如果我看 the StrictMath
Javadoc online ,我没有看到任何提及 strictfp
的内容。例如,toRadians()
Javadoc 的顶行内容为
public static double toRadians(double angdeg)
我使用的是JDK 1.8.0_241,运行时稍微领先。相当肯定它是 Oracle JDK。据我所知,StrictMath
的 JDK 源代码中的 Javadoc 注释与上面链接的 Oracle 页面中发布的内容相匹配。
Javadoc 工具是否忽略了 strictfp
修饰符,或者 Oracle 故意将其从生成的 StrictMath
Javadoc HTML 页面中取出?
(我尝试为虚拟 strictfp
函数生成 Javadoc,但在我尝试执行此操作的项目中似乎出现了一大堆看似不相关的 Javadoc 错误)。
最佳答案
作为documentation Java 8 的 javadoc
说:
The
javadoc
command can include the modifierspublic
,protected
,private
,abstract
,final
,static
,transient
, andvolatile
, but notsynchronized
ornative
. Thesynchronized
andnative
modifiers are considered implementation detail and not part of the API specification.
它没有明确列出 strictfp
,但由于 strictfp
是影响方法实现的功能,而不是影响方法的使用方式,因此将其排除在外原因。
关于java - 为什么 Oracle JDK Javadoc 不包含严格浮点修饰符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64399055/