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

final treatment of anonymous classes not marked in .class files?

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 1.4.1
    • Fix Version/s: None
    • Component/s: specification
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_2000

      Description

      Name: gm110360 Date: 11/11/2002


      FULL PRODUCT VERSION :
      jdk 1.4.1 and earlier versions

      FULL OPERATING SYSTEM VERSION :
      Win2000

      A DESCRIPTION OF THE PROBLEM :
      jls states, that anonymous classes are implicit final.
      But it seems, the class-files are not marked as such.
      An anonymous class is compiled to a separate class-file
      named like SomeClass$1 . When I open this class-file with
      JBuilder, it is (somewhat) decompiled, but shows no 'final'
      modifier.
      Nothing prevents me to compile and run something like:
       Object o = new SomeClass$1() {};
      in another class in the same package.
      I think, this is not intended. I don't have headache from
      this - but I just want to be sure, that the VM can
      immediatly use the fact, that an anonymous class (and it's
      methods) is final, without too much 'hotspotting'.
      Typical application of anonymous classes like comparators
      would immediatley benefit from this.
      I propose to explicitly mark class files compiled from
      anonymous classes as 'final'.



      REPRODUCIBILITY :
      This bug can be reproduced always.
      (Review ID: 166886)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                abuckley Alex Buckley
                Reporter:
                gmanwanisunw Girish Manwani (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: