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, 12 Oct 2014 22:27:59 +0900
- Organization: Geomatys
Hello all
Sorry for having missed this discussion... (I was moving). I just saw
the proposed changes in method signature and would like to strongly
object. What I have seen so far completely destroy type-safety! The
compiler would happily accept any illegal operation like "seconds =
kilogram.pow(2)" without a warning! I understand the wish to avoid <?>
in generic method signatures, but there is simply nothing we can do in
Java for any operation that do not return the exact same type, or a
sub-type or a super-type of one of the argument. This is not a bad
design of the library - this is a limitation of the Java language.
Martin