2

If I look at the StrictMath.toRadians() in the NetBeans Javadoc window, the top two lines read

java.​lang.​StrictMath
public static strictfp double toRadians(double angdeg)

That makes sense, since the JDK I'm using has StrictMath.toRadians() defined with the strictfp modifier. However, if I look at the StrictMath Javadoc online, I see no mention whatsoever of strictfp. The top line of the toRadians() Javadoc, for example, reads

public static double toRadians(double angdeg)

I'm using the JDK 1.8.0_241, the runtime is slightly ahead. Fairly certain it's the Oracle JDK. As far as I can tell, the Javadoc comments in the JDK source for StrictMath match what is posted in the Oracle page linked above.

Is it that the Javadoc tool ignores the strictfp modifier or is it that Oracle deliberately took it out of the generated StrictMath Javadoc HTML pages?

(I tried to generate Javadoc for a dummy strictfp function, but it seems I've got a whole bunch of seemingly unrelated Javadoc errors in the project I tried to do that in).

Alonso del Arte
  • 1,005
  • 1
  • 8
  • 19

1 Answers1

3

As the documentation of javadoc for Java 8 says:

The javadoc command can include the modifiers public, protected, private, abstract, final, static, transient, and volatile, but not synchronized or native. The synchronized and native modifiers are considered implementation detail and not part of the API specification.

It doesn't explicitly list strictfp, but since strictfp is a feature that affects the implementation of the method, not how it is used, it is excluded for that reason.

Andreas
  • 154,647
  • 11
  • 152
  • 247
  • 1
    I would consider `strictfp` part of the specification. – user207421 Oct 17 '20 at 08:44
  • @MarquisofLorne No more than `synchronized` is not being part of the specification for the out-dated [`Vector`](https://docs.oracle.com/javase/8/docs/api/java/util/Vector.html) class, even though the text of the javadoc says *"Vector is synchronized"*. Notice that javadoc of [`StrictMath`](https://docs.oracle.com/javase/8/docs/api/java/lang/StrictMath.html) doesn't say anything about `strictfp`, it only talks about `fdlibm` and "IEEE 754 core function", so the class could choose to implement all the methods as `native`, in which case `strictfp` wouldn't matter. It's an *implementation* detail! – Andreas Oct 17 '20 at 11:32