-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
8
-
x86
-
windows_7
FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
See test script below. First getInterface call returns non-null; second returns null. The only difference is the additional static method. Since static methods are not overrideable, their presence should be of no consequence.
--------
import javax.script.*;
class Test {
public static void main(String[] args) throws Throwable {
ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript");
engine.eval("var obj = { run: function() {} };");
System.out.println(((Invocable)engine).getInterface(engine.get("obj"), A.class));
System.out.println(((Invocable)engine).getInterface(engine.get("obj"), B.class));
}
public interface A {
void run();
}
public interface B {
void run();
static void foo() {}
}
}
--------
I know I've filed this bug under the wrong subcategory -- that's your own stupid fault because nothing encompassing javax.script is on the list. Deal with it. I know you won't, though -- I am beyond sick and tired of every bug I report being flagrantly ignored, but I'll keep trying anyway. Perhaps somewhere, someday, someone will at least read one of them.
REPRODUCIBILITY :
This bug can be reproduced always.
A DESCRIPTION OF THE PROBLEM :
See test script below. First getInterface call returns non-null; second returns null. The only difference is the additional static method. Since static methods are not overrideable, their presence should be of no consequence.
--------
import javax.script.*;
class Test {
public static void main(String[] args) throws Throwable {
ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript");
engine.eval("var obj = { run: function() {} };");
System.out.println(((Invocable)engine).getInterface(engine.get("obj"), A.class));
System.out.println(((Invocable)engine).getInterface(engine.get("obj"), B.class));
}
public interface A {
void run();
}
public interface B {
void run();
static void foo() {}
}
}
--------
I know I've filed this bug under the wrong subcategory -- that's your own stupid fault because nothing encompassing javax.script is on the list. Deal with it. I know you won't, though -- I am beyond sick and tired of every bug I report being flagrantly ignored, but I'll keep trying anyway. Perhaps somewhere, someday, someone will at least read one of them.
REPRODUCIBILITY :
This bug can be reproduced always.
- duplicates
-
JDK-8031359 Invocable.getInterface() works incorrectly if interface has default methods
- Resolved