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

ClassCastException with arguments usage

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b155
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        This is from nashorn-dev email alias:

        http://mail.openjdk.java.net/pipermail/nashorn-dev/2016-September/006484.html

        Test:


        function F(SOME_PARAMETER) {
          Function.prototype.call.apply(G, arguments);
        }

        function G(){
          this;
          F("SOME_ARGUMENT");
        }

        G();


        Stack trace:

        $ jjs -version test.js
        nashorn 1.8.0_101
        Exception in thread "main" java.lang.ClassCastException: Cannot cast
        jdk.nashorn.internal.objects.NativeArguments to [Ljava.lang.Object;
        at
        java.lang.invoke.MethodHandleImpl.newClassCastException(MethodHandleImpl.java:361)
        at
        java.lang.invoke.MethodHandleImpl.castReference(MethodHandleImpl.java:356)
                ...
        ```

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  hannesw Hannes Wallnoefer
                  Reporter:
                  sundar Sundararajan Athijegannathan
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: