You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Jérôme Leroux (JIRA)" <ji...@apache.org> on 2015/01/05 14:51:34 UTC

[jira] [Created] (BCEL-187) Verification error when an invoke references a method defined in superclass

Jérôme Leroux created BCEL-187:
----------------------------------

             Summary: Verification error when an invoke references a method defined in superclass
                 Key: BCEL-187
                 URL: https://issues.apache.org/jira/browse/BCEL-187
             Project: Commons BCEL
          Issue Type: Bug
          Components: Verifier
    Affects Versions: 5.2, 6.x
            Reporter: Jérôme Leroux


Assuming a class A with a method foo() and a class B subclass of A. If an invoke opcode references the method B.foo() then the bytecode verifier raises an error with the following error message:
{quote}
Referenced method 'foo' with expected signature '()void' not found in class 'B'. The native verifier does allow the method to be declared in some superinterface, which the Java Virtual Machine Specification, Second Edition does not.
{quote}

I can't find where in the _Java Virtual Machine Specification, Second Edition_ this restriction is defined.

The verification of the bytecode generated by the following code fails:
{code:java}
public class TestLegalInvokeInterface01{

    public static void test1(Interface01 t){
        t.run();
    }
}

interface Interface01 extends Runnable {
    
}
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)