BeanLinker assumes fixed array type linkage

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • 9
    • Affects Version/s: 9
    • Component/s: core-libs
    • None

      With the introduction of JDK-8157225, the following problem arises:

      $ jjs
      jjs> var intArray = Java.type("int[]")
      jjs> var doubleArray = Java.type("double[]")
      jjs> var arrs = [new intArray(0), new doubleArray(0)]
      jjs> for (var i in arrs) arrs[i].length
      java.lang.ClassCastException: Cannot cast [D to [I

      At a call site, array length getters will now assume the first array type encountered as fixed.

      This can be addressed by using an exact type match as a temporary solution, and by introducing a more sophisticated scheme that honours different array types as a permanent solution.

            Assignee:
            Michael Haupt
            Reporter:
            Michael Haupt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: