[ 
https://issues.apache.org/jira/browse/MATH-1406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15953142#comment-15953142
 ] 

Michael Borcherds edited comment on MATH-1406 at 4/3/17 8:47 AM:
-----------------------------------------------------------------

GWT documentation refers to what is supported, rather than what isn't :)

re Clone:
http://stackoverflow.com/questions/7577865/gwt-linkedhashmap-clone-issue


re ClassCastException
This works OK
{noformat}
         * @throws ClassCastException
         *             when <i>obj1</i> is not a <code>Comparable</code>, or 
when
         *             <code>((Comparable)obj1).compareTo(obj2)</code> does
         */
        @Override
        public int compare(T obj1, T obj2) {
                return obj1.compareTo(obj2);
        }
{noformat}

but the other uses
try { do a cast } catch (ClassCastException e)
simply don't throw an Exception in GWT so lead to runtime rather than 
compile-time errors (nasty!)

https://dev.geogebra.org/trac/changeset/32007


was (Author: murkle):
GWT documentation refers to what is supported, rather than what isn't :)

re Clone:
http://stackoverflow.com/questions/7577865/gwt-linkedhashmap-clone-issue


re ClassCastException
This works OK
{noformat}
         * @throws ClassCastException
         *             when <i>obj1</i> is not a <code>Comparable</code>, or 
when
         *             <code>((Comparable)obj1).compareTo(obj2)</code> does
         */
        @Override
        public int compare(T obj1, T obj2) {
                return obj1.compareTo(obj2);
        }
{noformat}

but the other uses
try { do a cast } catch (ClassCastException e)
simply don't throw an Exception in GWT so lead to runtime rather than 
compile-time errors (nasty!)

> official support for compiling on GWT 2.8
> -----------------------------------------
>
>                 Key: MATH-1406
>                 URL: https://issues.apache.org/jira/browse/MATH-1406
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Michael Borcherds
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> Context: at the moment Apache Commons Math can't be compiled using GWT (to 
> allow it to be made into a JavaScript library for example)
> http://www.gwtproject.org/
> Is there any interest in allowing Apache Commons Math to be officially 
> supported on GWT?
> With GWT 2.8.0 the changes needed aren't too hard to get most of it to compile
> You can see the diff from 3.6.1 here:
> https://github.com/murkle/commons-math/issues/1



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to