[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-lambda-dev
Subject:    Defender methods and compatibility
From:       peter.levart () marand ! si (Peter Levart)
Date:       2010-12-01 8:43:47
Message-ID: 201012010943.47253.peter.levart () marand ! si
[Download RAW message or body]

On 11/30/10, Mark Thornton wrote:
> On 30/11/2010 08:18, Peter Levart wrote:
> > So the preferred way of defining a common extension method which could 
> > be re-used by other vendors is to define a common super-interface with 
> > a single extension method which all concerned interfaces would extend. 
> > No SC breakage would result if this "single" definition is ever 
> > changed (being inline or not).
> That common super interface needs to include all the methods relevant to 
> the extension method.

In the absence of common super-interface two extension methods in unrelated \
interfaces with common default linkage means that the target static method has to \
deal with a common super-type of both interfaces (as 1st argument) which is \
java.lang.Object. Either it only has access to Object members or it has to assume \
different possible run-time implementations that could be passed to it and cast \
(which is ugly). So a common super-interface is desirable in this respect too.

Peter

> 
> Mark
> 
> 
> 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic