-
Bug
-
Resolution: Fixed
-
P2
-
9
-
None
-
b120
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.
$ 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.
- relates to
-
JDK-8157251 BeanLinker relinks array length operations for array types
-
- Resolved
-
-
JDK-8157225 adopt method handle for array length getter in BeanLinker
-
- Resolved
-