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: Sun, 19 Oct 2014 23:21:54 +0900
- Organization: Geomatys
Le 19/10/14 04:20, Otávio Gonçalves de Santana a écrit :
>
Martin, maybe I expressed me bad.
>
Java has the Generic resources in Java 1.5, but it should to keep the
>
compatibility to older version of Java.
>
When I told "new API", I means API after the generics, in other words,
>
Java 1.6 or above.
>
If you look to the Since annotations of this example you will see
>
almost always 1.4 and Just one 1.5 , in other words, no one is new API.
I do not think that it matter much. The JDK team had the freedom to add
whatever parameterized type they wanted in the API - this was the
purpose of "type erasure". They were not forced to use <?> for
preserving compatibility. Indeed, they used massively more complex types
in large part of the API: collections (which is a Java 1.2 API),
reflection, swing, etc. Consequently I think that their use of
Comparable<?> was a design choice, not a compatibility constraint.
<?> is not necessarily "old school", "legacy" or "bad design". In some
situations it is really the most appropriate signature.
Martin