Improve message of ArrayStoreException.

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 11
    • Affects Version/s: 11
    • Component/s: hotspot
    • None
    • b19

        Print the problematic types in ArrayStoreException.

        When doing arraycopy:

        "arraycopy: type mismatch: can not copy double[] into object array[]"
        "arraycopy: type mismatch: can not copy object array[] into boolean[]"

        For Object arrays, be more precise:

        If one of the objects passed to araycopy is not an array at all:
        "arraycopy: source type java.lang.String is not an array"
        "arraycopy: destination type java.lang.String is not an array"
        If the element types of the array mismatch:
        "arraycopy: type mismatch: can not copy java.lang.String[] into java.util.Date[]"
        If one of the elements of source can not be cast to the type of the destination:
        "arraycopy: element type mismatch: can not cast one of the elements of java.lang.Object[] to the type of the destination array, java.util.Date"


        For JNI call to SetObjectArrayElement() print types and index:

        "type mismatch: can not store java.lang.String to java.util.Date[0]"
        "type mismatch: can not store java.lang.String to java.lang.Object[1][][]"

              Assignee:
              Goetz Lindenmaier
              Reporter:
              Goetz Lindenmaier
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: