Use Advanced Search to search the entire archive.
Re: Remove "generic" multiply/divide operations from Quantity
- From: Werner Keil <
>
- To:
- Subject: Re: Remove "generic" multiply/divide operations from Quantity
- Date: Sun, 19 Oct 2014 21:13:01 +0200
Quantity JavaDoc clearly says "Some Typesafety, so does the spec and at the
end of the day the compiler accepts every Quantity in either case.
The <?> seems less future proof towards Java SE 8+ as it causes compile
failures at exactly those places (divide(), multiply()) already;-O
Please ask OpenJDK guys at Oracle, if they think that signature is safe for
1.0
Werner
Am 19.10.2014 20:48 schrieb "Martin Desruisseaux" <
>:
>
Le 20/10/14 03:42, Werner Keil a écrit :
>
>
>
> But you can cast to everything (except the generic argument like
>
> Energy or Mass directly of course;-)
>
>
>
The user have to do it explicitly, and he get a warning.
>
>
With UNITSOFMEASUREMENT-62 lot of users would wrongly assume that
>
because his code compile without warning, the type are guaranteed
>
correct. Because this is the whole purpose of parameterized type.
>
>
Martin
>
>