Methods declared in a final class are final (JLS 8.4.3.3) and should
presumably be marked as such in the classfile.
william.maddox@Eng 1999-06-23
The spec does not require that the ACC_FINAL bit actually be set for these
methods in the classfiles. It is sufficient that the class be final, and
therefore cannot be subclassed, to insure that the methods cannot be overridden.
This is presumably the intent of the spec. In any case, the compiler has not
set the ACC_FINAL bits for such methods in the past, and doing so introduces
serialization incompatibilities. In the absence of an explicit statement in
the spec that the implicit final-ness of these methods be explicitly marked
in the classfile with the ACC_FINAL bit, we will leave it unset.
william.maddox@Eng 1999-09-23
presumably be marked as such in the classfile.
william.maddox@Eng 1999-06-23
The spec does not require that the ACC_FINAL bit actually be set for these
methods in the classfiles. It is sufficient that the class be final, and
therefore cannot be subclassed, to insure that the methods cannot be overridden.
This is presumably the intent of the spec. In any case, the compiler has not
set the ACC_FINAL bits for such methods in the past, and doing so introduces
serialization incompatibilities. In the absence of an explicit statement in
the spec that the implicit final-ness of these methods be explicitly marked
in the classfile with the ACC_FINAL bit, we will leave it unset.
william.maddox@Eng 1999-09-23
- duplicates
-
JDK-4386357 private method in a final class
-
- Closed
-
- relates to
-
JDK-4396587 "A private method and all methods declared in a final class are final"
-
- Resolved
-