...
Other kinds of compatibility include serial compatibility for Serializable types and migration compatibility. Migration compatibility was a constraint on how generics were added to the platform; libraries and their clients had to be able to be generified independently while preserving the ability of code to be compiled and run.
...
In the original version of Lib
, a call to foo
with an integer argument will resolve to foo(double)
and under the rules for method invocation conversion the value of the int
argument will be converted to a double
through a primitive widening conversion. So given client code
public class Client { public static void main(String... args) { int i = 42; double d = (new Lib()).foo(i); } }
...