Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8034044 Class.getModifiers() returns "static" for anonymous classes
  3. JDK-8184946

Release Note: javac no longer marks anonymous classes 'static'

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Delivered
    • Icon: P4 P4
    • 9
    • 9
    • tools
    • Verified

      Prior to JDK 9, javac set the 'static' modifier on anonymous classes declared in a static context, e.g., in static methods or static initialization blocks. This contradicts the Java Language Specification, which states that anonymous classes are never static. In JDK 9, javac does not mark anonymous classes 'static', whether they are declared in a static context or not.

            igerasim Ivan Gerasimov
            igerasim Ivan Gerasimov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: