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

POJO setter using [] syntax throws an exception

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b47
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        This program (requires jdk.nashorn.test.* classes):

        var x = new (Java.type("jdk.nashorn.test.models.PropertyBind"))
        var n = "writeOnly";
        x[n] = 2
        print(x.peekWriteOnly());

        throws:

        Exception in thread "main" java.lang.invoke.WrongMethodTypeException: expected (Object,int)void but found (Object,int)Object
        at java.lang.invoke.Invokers.newWrongMethodTypeException(Invokers.java:294)
        at java.lang.invoke.Invokers.checkExactType(Invokers.java:305)
        at jdk.nashorn.internal.scripts.Script$Recompilation$2$x$cu1$restOf.:program(x.js:3)
        ...

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                attila Attila Szegedi
                Reporter:
                attila Attila Szegedi
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: