Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4396587

"A private method and all methods declared in a final class are final"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 5.0
    • 1.4.0
    • specification
    • None
    • 1.5
    • generic
    • solaris_7

      The text in the synopsis appears in section 8.4.3.3 (final methods).

      There are two problems with this sentence. First, "declared in" should more correctly be "of" because of inner classes. Specifically, methods of inner classes need not necessarily be final just because the outer class is final.

      The more serious problem is that this sentence should just be removed. While the sentence is a useful exposition on the consequences of language rules appearing elsewhere, this sentence (if left in the spec) would have additional consequences beyond that, and these additional consequences aren't correct.

      Specifically, see bugs 4249112 and 4386357. Those bugs show that the current compilers do NOT expose this implied finalness to the reflection interface. What's worse, we can't change this in the compiler to comply with the current wording because it would introduce a serialization incompatibility in the libraries, documented in bugid 4249112.

      So my suggestion is to simply remove this sentence or reword it so that it is clearly just useful exposition and not a language rule.

      neal.gafter@Eng 2000-12-08

            gbrachasunw Gilad Bracha (Inactive)
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: