hugoloza / gwt-mobile-webkit

Automatically exported from code.google.com/p/gwt-mobile-webkit
2 stars 0 forks source link

JSO to Java class cast exception, HelloDatabaseSample (and doc) #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Database API

What steps will reproduce the problem?
1.run HelloDatabaseSample
2.click 'Add Click'
3.

What is the expected output? What do you see instead?
see: java.lang.ClassCastException: com.google.gwt.core.client.JavaScriptObject$ 
cannot be cast to java.util.Date at ...ClickRow$.getClicked$(ClickRow.java)

What version of the product are you using? On what operating system?
gwt-html5-database-1.5.1.tar.gz; Safari Version 5.0.2 (6533.18.5); GWT2.0.4; 
OSX10.6.4

Please provide any additional information below.

ClickRow contains illegal JS native to Java cast, in return type. Cannot cast 
JSO Date to java.util.Date.

    public final native Date getClicked() /*-{
        var dateClicked = new Date();
        dateClicked.setTime(this.clicked);
        return dateClicked;
    }-*/;

replace with:
    public final Date getClicked() {
        return new Date(getTime());
    }

    public final long getTime() {
        return (long) doubleTime();
    }

    private native double doubleTime() /*-{
        return this.clicked;
    }-*/;

Original issue reported on code.google.com by markh.ne...@gmail.com on 17 Sep 2010 at 8:53

GoogleCodeExporter commented 9 years ago
Thanks for reporting!

Original comment by bguijt on 17 Sep 2010 at 9:31

GoogleCodeExporter commented 9 years ago
Will make the change this weekend.

Original comment by bguijt on 10 Dec 2010 at 2:06

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r340.

Original comment by bguijt on 12 Dec 2010 at 10:34