Apologies, I did not look very hard for the already reported issue. null is required to indicate the browser does not support providing that specific value I believe, so I can understand why Double was used.
For now I've used my own overlay. Thanks On Wednesday, January 25, 2017 at 2:36:15 PM UTC, Thomas Broyer wrote: > > > > On Wednesday, January 25, 2017 at 11:56:20 AM UTC+1, Paul wrote: >> >> See >> http://www.gwtproject.org/javadoc/latest/com/google/gwt/geolocation/client/Position.Coordinates.html >> >> Several methods return Double e.g. >> >> public Double getSpeed() >> >> The JavaScript object overlay that implements this method is... >> >> @Override >> public final native Double getSpeed() /*-{ >> return this.speed || null; >> }-*/; >> >> >> However this.speed is a primitive double or null according to ... >> >> https://developer.mozilla.org/en-US/docs/Web/API/Coordinates >> <https://www.google.com/url?q=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FAPI%2FCoordinates&sa=D&sntz=1&usg=AFQjCNFFjUO8wVqBCmQhl4-iCr243DE_Uw> >> >> So surely this is incorrect? >> > > In GWT 2.7.0 and earlier, returning a JS Number as a java.lang.Double > would be an error; but in GWT 2.8.0 java.lang.Double and double are > interchangeable (same for java.lang.Boolean and boolean). This was actually > reported 2 years ago: https://github.com/gwtproject/gwt/issues/9058 > <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fgwtproject%2Fgwt%2Fissues%2F9058&sa=D&sntz=1&usg=AFQjCNFomPq8h9rzoTY-hQUokud_bFaqGg> > It is however probably incorrect to turn a 0 value into a null yes. > > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
