Use Advanced Search to search the entire archive.
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