Link Details

Link 1109603 thumbnail
User 448255 avatar

By dotCore
Submitted: Feb 11 2014 / 01:04

This week at JavaOne, Joe Darcy pointed out to me an interesting difficulty he ran into recently when trying to change various JDK classes to use covariant return types for clone(). It turns out that changing the return type of an overridden method on a class to be more specific can break behavior compatibility for child classes which themselves had already created an override of the same method. The original discussion is on the OpenJdk Core Libs Dev mailing list. To try to make it a touch easier to follow, I'll give a bit of background, and construct a stand-alone example.
  • 4
  • 0
  • 125
  • 26

Add your comment

Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (4)

Voters Against This Link (0)

    Debugging JavaScript
    Written by: Ashutosh Sharma
    Featured Refcardz: Top Refcardz:
    1. Design Patterns
    2. OO JS
    3. Cont. Delivery
    4. Java EE7
    5. HTML5 Mobile
    1. Java EE7
    2. Spring Annotations
    3. Git
    4. Java
    5. REST