JDK 8 code review request for 7140820 Add covariant overrides to Collections clone methods

Ulf Zibis Ulf.Zibis at gmx.de
Tue Jan 31 13:02:20 UTC 2012


Am 30.01.2012 07:52, schrieb Rémi Forax:
>
> WTF !
>
> while it's maybe a binary compatible change, I haven't take a look to all modified classes to be sure
> it's not a source compatible change.
>
> People had created class that inherits from ArrayList and override clone,
> while it's not a good practice, there is a *lot* of code from pre-1.5 days that does exactly that,
> this change will simply break all those codes.

I guess, as not source compatible for, you think about case A, but not case B? :
class SubClass extends JdkApiClass {
     @Override  // case A
     Object clone() {...}
     @Override  // case B
     SubClass clone() {...}
}

-Ulf




More information about the core-libs-dev mailing list