While refactoring some code, I came across this oddity. It seems impossible to control the strictfp property for an initializer without affecting the entire class. Example:
public class MyClass {
public final static float[] TABLE;
strictfp static {
TABLE = new float[...];
}
public static float[] myMethod(float[] args) {
}
}
From JLS, section 8.1.1.3 I understand that the initializer will be strictfp if the class is declared using the strictfp modifier. But he also says that he does all methods implicitly strictfp:
The effect of the strictfp modifier is that all popup or double expressions inside a class declaration (including inside variable initializers, initializer initializers, static initializers, and constructors) are explicitly FP-strict (Β§15.4).
, , , , , .
, , , strictfp? strictfp, ?
, , , strictfp'dness?