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

BeanLinker assumes fixed array type linkage

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 9
    • 9
    • 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.

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

              Created:
              Updated:
              Resolved: