Skip to main content

Re: Remove "generic" multiply/divide operations from Quantity

  • From: Martin Desruisseaux < >
  • To:
  • Subject: Re: Remove "generic" multiply/divide operations from Quantity
  • Date: Mon, 20 Oct 2014 03:14:48 +0900
  • Organization: Geomatys

Le 20/10/14 02:52, Werner Keil a écrit :
> Without repeating myself, the cast to Energy fails miserably. I tried
> to revive your Reflection based approach, but no operations like
> add(),... works.

Point me to a test case showing the failure, and I will fix the code.


> Nice you mention Enum, it uses exactly the signature, Otavio suggested
> since Java 5;-)
>
> http://docs.oracle.com/javase/6/docs/api/java/lang/Enum.html
>
Sight... Werner you still don't understand. The <T extends Enum<T>> T
valueOf(Class<T> enumType, String name) method signature establishes a
relationship between the argument and the return value. It said "/The
type of the returned Enum is the one specified by the Class argument/".
This relationship is real, and the Class object provides all needed
information for verifying that. By contrast, the UNITSOFMEASUREMENT-62
method signature does not describe the real relationship between
argument and return value, and for this reason is unsafe.


> About 200 or so cases in our implementations of SystemOfUnits alone,
> that's not "cornerstone"
>
I will need to create a fork of the RI and fix it on my side, since I
want to see those cases myself.

    Martin



Re: Remove "generic" multiply/divide operations from Quantity

(continued)

Re: Remove "generic" multiply/divide operations from Quantity

Otávio Gonçalves de Santana 10/18/2014

Re: Remove "generic" multiply/divide operations from Quantity

Martin Desruisseaux 10/19/2014

Re: Remove "generic" multiply/divide operations from Quantity

Werner Keil 10/19/2014

Re: Remove "generic" multiply/divide operations from Quantity

Martin Desruisseaux 10/19/2014

Re: Remove "generic" multiply/divide operations from Quantity

Jean-Marie Dautelle 10/19/2014

Re: Remove "generic" multiply/divide operations from Quantity

Martin Desruisseaux 10/19/2014

Re: Remove "generic" multiply/divide operations from Quantity

Werner Keil 10/19/2014

Re: Remove "generic" multiply/divide operations from Quantity

Werner Keil 10/19/2014

Re: Remove "generic" multiply/divide operations from Quantity

Martin Desruisseaux 10/19/2014

Re: Remove "generic" multiply/divide operations from Quantity

Werner Keil 10/19/2014

Re: Remove "generic" multiply/divide operations from Quantity

Martin Desruisseaux 10/19/2014

Re: Remove "generic" multiply/divide operations from Quantity

Werner Keil 10/19/2014

Re: Remove "generic" multiply/divide operations from Quantity

Martin Desruisseaux 10/19/2014

Re: Remove "generic" multiply/divide operations from Quantity

Werner Keil 10/19/2014

Re: Remove "generic" multiply/divide operations from Quantity

Martin Desruisseaux 10/19/2014

Re: Remove "generic" multiply/divide operations from Quantity

Werner Keil 10/19/2014

Re: Remove "generic" multiply/divide operations from Quantity

Martin Desruisseaux 10/19/2014

Re: Remove "generic" multiply/divide operations from Quantity

Werner Keil 10/19/2014

Re: Remove "generic" multiply/divide operations from Quantity

Otávio Gonçalves de Santana 10/17/2014

Re: Remove "generic" multiply/divide operations from Quantity

Otávio Gonçalves de Santana 10/17/2014

Re: Remove "generic" multiply/divide operations from Quantity

Werner Keil 10/17/2014
 
 
Close
loading
Please Confirm
Close