Wednesday, August 23, 2017

Re: ClassCastException in generics

ArrayBuffer arrayBuffer = fileReader2.resultArrayBuffer();
Logger.log("instanceOfArrayBuffer for file = " + isInstanceOfArrayBuffer(arrayBuffer));
ArrayBuffer good = new ArrayBuffer(arrayBuffer.getByteLength());
new Int8Array(good).set(new Int8Array(arrayBuffer));
Logger.log("instanceOfArrayBuffer for good copy = " + isInstanceOfArrayBuffer(good));
handleJetFile(name, arrayBuffer);

Oh, my bad, that was the typo, should be 

handleJetFile(name, good); 

Now it works. Oh magic. GWT rtti is a hard rock.

I think I do not need to have two buffers to workaround that issue. (better to box_
Also I do not want to make a copy of all JsType classes, one with "name = Object" and other with good names. 
The best would be still to use a boxing class.

-Kirill
 
 

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment