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

Attempt to resolve abstract method in concrete class fails with AbstractMethodError

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 8u20
    • hs25, emb-8u26, 8, 9
    • hotspot
    • b03
    • Not verified

    Backports

      Description

        Consider the following case:
          class T1 { public void m() {} }
          class T2 { public abstract void m(); }
          class T3 { public void m() {} }

        Call site: T3 { invokevirtual T2.m()V T3 }

        NB: class T2 isn't marked as abstract.

        VM: AbstractMethodError: p1.T2.m()V
        JVMS: T3.m() should be invoked

        The following check during method resolution is removed in JVMS-8 [1]:
        JVMS-5.4.3.3. Method Resolution
        "If method lookup succeeds and the method is abstract, but C is not abstract, method resolution throws an AbstractMethodError."

        ILW = HLM = P3

        I = H = JVMS-8 violation; severely affects testing of default methods
        L = L = javac doesn't generate such bytecode
        W = M = add ACC_ABSTRACT to class' attributes

        [1] http://cr.openjdk.java.net/~dlsmith/jsr335-0.9.1/J.html

        Attachments

          Issue Links

            Activity

              People

                ccheung Calvin Cheung
                vlivanov Vladimir Ivanov
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: