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

VM permits illegal <clinit> access_flags, versions 51-52

    Details

    • Subcomponent:
    • Resolved In Build:
      b85
    • Verification:
      Verified

      Backports

        Description

        According to http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-2.html#jvms-2.9-210 for classes version 51, 52 <clinit>()V methods without ACC_STATIC are regular methods.
        According to http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6-200-A and following assertions following methods should throw CFE:

        * 'public private protected' method for class (http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6-200-A.2)
        * 'private protected abstract' method for interface (http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6-200-A.3, http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6-200-A.4)
        * 'protected final' method in interface (http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6-200-A.3)

        Actually VM accepts them (it looks like it ignores access_flags in this case).
        Was found on jdk9b78, jck tests are under development, tck_red will be added after tests completion.
        Some examples are attached, more examples will be added by request.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  hseigel Harold Seigel
                  Reporter:
                  asolodkaya Anastasiya Solodkaya (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: