JDK-8159034 : 4 nashorn ant tests fail with latest jdk9-dev build with IncompatibleClassChangeError
  • Type: Bug
  • Component: core-libs
  • Sub-Component: jdk.nashorn
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2016-06-08
  • Updated: 2021-09-23
  • Resolved: 2016-06-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u321Fixed 9 b123Fixed
Related Reports
Relates :  
Relates :  
Description
4 nashorn ant tests fail with latest jdk9-dev build

All failures have similar exception message:

 java.lang.IncompatibleClassChangeError: Method java.util.function.Function.andThen(Ljava/util/function/Function;)Ljava/util/function/Function; must be InterfaceMethodref constant
Comments
URL: http://hg.openjdk.java.net/jdk9/jdk9/nashorn/rev/b30f5b333179 User: lana Date: 2016-06-15 19:03:36 +0000
15-06-2016

URL: http://hg.openjdk.java.net/jdk9/dev/nashorn/rev/b30f5b333179 User: sundar Date: 2016-06-08 15:10:45 +0000
08-06-2016

Java adapter generates invokespecial to call inherited default methods of interfaces [without InterfaceMethodref CP entry] - which used to work. After the recent hotspot change, this does not work anymore.
08-06-2016

This recent HotSpot changeset introduced a new error condition and the error message observed here: http://hg.openjdk.java.net/jdk9/dev/hotspot/rev/ea45fb60fbbe
08-06-2016

File: x.js var func = new java.util.function.Function() { apply: function(arg) { print("func called with " + arg); return arg.toUpperCase(); } }; // Function.andThen is a default method func.andThen(func)("hello"); prints: func called with hello func called with HELLO Fails with the latest jdk9-build with Exception in thread "main" java.lang.IncompatibleClassChangeError: Method java.util.function.Function.andThen(Ljava/util/function/Function;)Ljava/util/function/Function; must be InterfaceMethodref constant at jdk.nashorn.javaadapters.java_util_function_Function.andThen(Unknown Source) at jdk.nashorn.internal.scripts.Script$Recompilation$2$x$cu1$restOf.:program(jdk.scripting.nashorn.scripts/x.js:10) at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(jdk.scripting.nashorn@9-internal/ScriptFunctionData.java:654) at jdk.nashorn.internal.runtime.ScriptFunction.invoke(jdk.scripting.nashorn@9-internal/ScriptFunction.java:513) at jdk.nashorn.internal.runtime.ScriptRuntime.apply(jdk.scripting.nashorn@9-internal/ScriptRuntime.java:489) at jdk.nashorn.tools.Shell.apply(jdk.scripting.nashorn@9-internal/Shell.java:519) at jdk.nashorn.tools.Shell.runScripts(jdk.scripting.nashorn@9-internal/Shell.java:448) at jdk.nashorn.tools.Shell.run(jdk.scripting.nashorn@9-internal/Shell.java:186) at jdk.nashorn.tools.jjs.Main.main(jdk.scripting.nashorn.shell@9-internal/Main.java:102) at jdk.nashorn.tools.jjs.Main.main(jdk.scripting.nashorn.shell@9-internal/Main.java:78)
08-06-2016

No new regression test added as there are already tests cover calling inherited default methods on interfaces.
08-06-2016

No new regression test added as there are already tests cover calling inherited default methods on interfaces.
08-06-2016