ClassCastException ListGrid

This code crashes if you call addData(new Record()) followed by getRecords() on a setSaveLocally(true) listGrid. The cast is unneccesarily specific (it would be fine if it was (Record).

Fix - use ListGridRecord instead.

  private static ListGridRecord[] convertToListGridRecordArray(JavaScriptObject nativeArray) {
        if (nativeArray == null) {
            return new ListGridRecord[]{};
        }
        JavaScriptObject[] componentsj = JSOHelper.toArray(nativeArray);
        ListGridRecord[] objects = new ListGridRecord[componentsj.length];
        for (int i = 0; i < componentsj.length; i++) {
            JavaScriptObject componentJS = componentsj[i];
            ListGridRecord obj = (ListGridRecord) RefDataClass.getRef(componentJS);
            if (obj == null) obj = new ListGridRecord(componentJS);
            objects[i] = obj;
        }
        return objects;
    }

the code snip was from ListGrid (probably clear to you, but just in case)

Maybe I’m wrong about the specificity of the cast - however, it would be nice if the method did a type check and correctly converted any Record() to ListGridRecord() - maybe that should be done on addData() instead?