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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 5.0
    • Component/s: specification
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      1.5
    • CPU:
      generic
    • OS:
      solaris_7

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: