Message10352
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()");
}
} |
|
Date |
User |
Action |
Args |
2015-10-12 08:32:53 | alexgobbo | set | messageid: <1444638773.08.0.513594964801.issue2403@psf.upfronthosting.co.za> |
2015-10-12 08:32:53 | alexgobbo | set | recipients:
+ alexgobbo, zyasoft, darjus |
2015-10-12 08:32:53 | alexgobbo | link | issue2403 messages |
2015-10-12 08:32:52 | alexgobbo | create | |
|