Method reference conversion

Rémi Forax forax at univ-mlv.fr
Fri Dec 16 00:16:32 PST 2011


On 12/16/2011 08:28 AM, Uther wrote:
>> On Dec 15, 2011, at 4:10 PM, Brian Goetz wrote:
>>
>> Most likely outcome: no guarantees (such guarantees come with a cost) but it
>> is "highly likely" that method1 == method2. When we finish the implementation
>> of functional interface conversion we'll have a update.
> So Method reference are not really suited to Listeners. I think it's a
> shame since it was a really good use case of method reference.

If you have to unregister a listener, you have to store the listener in 
a field when you create it,
to be able to send the same reference when you unregister it.

If two method reference bound to the same object share the same reference
you need to cache them somewhere, so you create a performance tax 
everywhere you create a
method reference and it will never scale in a threaded environment.

Rémi



More information about the lambda-dev mailing list