Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8087136

regression: apply on $EXEC fails with ClassCastException

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 8u60, 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b69
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        File: test.js

        # this test requires -scripting mode

        $EXEC.apply(this, ["ls"]);
        print($OUT);

        -------
        The above test fails with the following tip. But, if passes if this changeset is reverted.

        $ hg tip
        changeset: 1313:a24cb0bf79bc
        tag: tip
        user: mhaupt
        date: Tue Jun 09 09:27:02 2015 +0200
        summary: 8080490: add $EXECV command to Nashorn scripting mode

        $ jjs -scripting -J-Djava.ext.dirs=dist test.js

        Exception in thread "main" java.lang.ClassCastException: Cannot cast jdk.nashorn.internal.runtime.Undefined to [Ljava.lang.Object;
        at java.lang.invoke.MethodHandleImpl.newClassCastException(MethodHandleImpl.java:361)
        at java.lang.invoke.MethodHandleImpl.castReference(MethodHandleImpl.java:356)
        at jdk.nashorn.internal.scripts.Script$Recompilation$1$test.:program(test.js:3)
        at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:640)
        at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:228)
        at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
        at jdk.nashorn.tools.Shell.apply(Shell.java:397)
        at jdk.nashorn.tools.Shell.runScripts(Shell.java:326)
        at jdk.nashorn.tools.Shell.run(Shell.java:172)
        at jdk.nashorn.tools.Shell.main(Shell.java:136)
        at jdk.nashorn.tools.Shell.main(Shell.java:112)

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  sundar Sundararajan Athijegannathan
                  Reporter:
                  sundar Sundararajan Athijegannathan
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: