commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject [Pool2] Alternative identity hashmap pool implementations
Date Fri, 06 Feb 2015 18:56:42 GMT
There seem to be a few use-cases for pools that always treat different
instances as different entries, rather than using the current equals()
check.

Would it make sense to implement alternative versions that accept an
object and wrap it in a class that implements equals() using == and
System.identityHashcode?

The IdentityWrapper class was suggested here:

https://issues.apache.org/jira/browse/POOL-283?focusedCommentId=14307637&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14307637

I think it could be done by subclassing the existing implementations
to provide the wrapping/unwrapping support.

There would be an overhead because the wrappers would need to be
created every time an object was passed in. The wrappers are very
small.

S.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message