Message10352

Author alexgobbo
Recipients alexgobbo, darjus, zyasoft
Date 2015-10-12.08:32:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1444638773.08.0.513594964801.issue2403@psf.upfronthosting.co.za>
In-reply-to
Content
Below an example - I use Jython 2.7.0. Java 1.8.0_11 and Java 1.8.0_51. The exception throws a VerifyError when declaring the class "MyClass" overriding get().


package test;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;

public class Test {

    public static interface TestInterface {

        default String get() {
            return "Unknown";
        }
    }

    public static class TestClass implements TestInterface {

        public String get() {
            return "Value";
        }
    }

    public static void main(String[] args) throws Exception {
        ScriptEngine engine = new ScriptEngineManager().getEngineByName("python");

        engine.eval("import test.Test.TestClass");
        engine.eval("o = test.Test.TestClass()");
        engine.eval("print o.get()"); //This is ok

        engine.eval("import test.Test.TestInterface");
        engine.eval("class MyClass(test.Test.TestInterface):\n"
                + "   def get(self):\n"
                + "       return 'value'");
        engine.eval("o = MyClass()");
        engine.eval("print o.get()");

    }
}
History
Date User Action Args
2015-10-12 08:32:53alexgobbosetmessageid: <1444638773.08.0.513594964801.issue2403@psf.upfronthosting.co.za>
2015-10-12 08:32:53alexgobbosetrecipients: + alexgobbo, zyasoft, darjus
2015-10-12 08:32:53alexgobbolinkissue2403 messages
2015-10-12 08:32:52alexgobbocreate