-
Bug
-
Resolution: Fixed
-
P4
-
1.2.0, 1.2.2
-
kestrel
-
generic
-
generic, solaris_2.5.1
Name: dkC59003 Date: 02/03/99
Javac does not generate a compile-time errors for 'strictfp'-modified abstract, native
and interface method declarations. It's true for the releases since JDK-1.2-V till
JDK-1.2.2-E. Sample source is below.
The recent "Updates to the Java Language Specification for JDK Release 1.2 Floating Point"
clearly defines in the p. "8.4.3 Method Modifiers" :
" A compile-time error occurs if a method declaration that contains the keyword
abstract also contains any one of the keywords private, static, final, native,
strictfp,or synchronized.A compile-time error occurs if a method declaration
that contains the keyword native also contains strictfp. "
The p. "9.4 Abstract Method Declarations" reads also :
" Note that a method declared in an interface must not be declared strictfp or
native or synchronized, or a compile-time error occurs, because those keywords
describe implementation properties rather than interface properties. "
=========================================
interface I {
strictfp void strictfpIntfMeth();
}
abstract public class Abstr {
abstract strictfp void abstStrictfp();
native strictfp void nativeStrictfp();
}
=========================================
======================================================================
Name: dkC59003 Date: 02/24/99
There are new tests in JCK 1.2.1 for checking this bug matter :
lang/FP/fpl014/fpl01401m1/fpl01401m1.html
lang/FP/fpl014/fpl01401m2/fpl01401m2.html
lang/FP/fpl014/fpl01401m3/fpl01401m3.html
lang/FP/fpl014/fpl01401m4/fpl01401m4.html
lang/FP/fpl014/fpl01401m5/fpl01401m5.html
lang/FP/fpl014/fpl01401m6/fpl01401m6.html
lang/FP/fpl014/fpl01401m7/fpl01401m7.html
They are being integrated now and they will be excluded with this bug number.
======================================================================
- duplicates
-
JDK-4194753 strictfp should not be permitted in interface or abstract instance methods
- Closed