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: Sat, 18 Oct 2014 17:24:01 +0900
- Organization: Geomatys
Le 17/10/14 11:51, Otávio Gonçalves de Santana a écrit :
>
And considering the old method, what do avoid me to to something like
>
that?:
>
>
Quantity<Time> time = ...;
>
Quantity<Length> length = ...;
>
Quantity<Mass> result = (Quantity<Mass>) time.multiply(length);
Nothing, but the user gets a "unsafe cast" warning while
UNITSOFMEASUREMENT-62 shutdown any warning, giving to the user the false
impression that is code is proved right.
The user can resolve the "unsafe cast" warning by using the (Mass) cast
instead of (Quantity<Mass>). There is no way however to make this cast
happen automatically in current Java (again, if you do not believe me,
see my proposal to restart the logical demonstration step-by-step).
Martin