Please review JDK-8059321

Aleksey Shipilev aleksey.shipilev at oracle.com
Mon Sep 29 18:22:25 UTC 2014


Yes, that's a simple adapter:
http://docs.oracle.com/javase/7/docs/api/java/util/Collections.html#newSetFromMap(java.util.Map)

See the example there.

-Aleksey.

On 09/29/2014 10:10 PM, Marcus Lagergren wrote:
> Aleksey - I still need the weak semantics, because I don’t want to hold on to the strings. Would that work for the WeakHashMap and preserve semantics? #iamnotajavaprogrammer.
> 
>>
>> The entire shenanigan would go away if you turn the Map into Set with
>> Collections.newSetFromMap(...), and then do add().
>>
>> -Aleksey.
>>
>>
> 




More information about the nashorn-dev mailing list