Closed GoogleCodeExporter closed 9 years ago
Very same with CustomConcurrentHashMap.entrySet()
:( no workaround for me, I'm crying...
Martin Schayna
Original comment by mschayna
on 12 Nov 2009 at 1:19
Thank you for reporting this! I've reproduced this on our side. We are
looking into
why this happens. It's true that the Map retains a strong reference to its
keySet,
but that keySet should not have a reference to anything (except the Map).
Original comment by kevin...@gmail.com
on 12 Nov 2009 at 6:56
Looks like my entire long, detailed response was eaten because I'd submitted
the
"Thank you.." response in another tab.
Basically, the VM's determination of when an object is reachable is imperfect.
With
your test code, for instance, all I have to do is extract the code that deals
with
weakKey into a separate method (so the test method just creates the map, passes
the
map to that method, then calls assertCleanup) and it suddenly starts working.
MapMaker is definitely not keeping a strong reference to your key.
Original comment by kevin...@gmail.com
on 12 Nov 2009 at 9:18
OK, thank you for quick response. I was too defensive and relying on my unit
tests.
Life needs some imperfection :)
Original comment by mschayna
on 12 Nov 2009 at 9:32
Original issue reported on code.google.com by
mschayna
on 12 Nov 2009 at 1:06Attachments: