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

javaarrayconversion.js test is flawed

    Details

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

      Backports

        Description

        test/script/basic/javaarrayconversion.js asserts that an array of java objects can't be convert to a primitive Java array using the line:
         Java.to([new Java.type(sourceType)()], targetType + "[]"
        expecting a TypeError. However the caught TypeError is actually "function type() { [native code] } is not a constructor function" because new is called on Java.type, not its result. So it should instead be:
         Java.to([new (Java.type(sourceType))()], targetType + "[]");
        After this change the test fails with "no TypeError encountered" what suggests a bug in Nashorn.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  sundar Sundararajan Athijegannathan
                  Reporter:
                  aw Andreas Woess
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: