keeganwitt / gmock

Automatically exported from code.google.com/p/gmock
6 stars 2 forks source link

Copy the weak reference hash map for POJO per-instance metaclass from groovy 1.6 to gmock #67

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Copy the code of weak reference hash map in
groovy 1.6 to gmock, which is using "System.identityHashCode()", because it
is better than the current implements of POJO per-instance metaclass in
gmock as the implements of groovy will not stop the POJO from being garbage
collected.

Original issue reported on code.google.com by JohnnyJianHY on 1 Mar 2009 at 1:41

GoogleCodeExporter commented 9 years ago

Original comment by JohnnyJianHY on 1 Mar 2009 at 1:42

GoogleCodeExporter commented 9 years ago

Original comment by julien.g...@gmail.com on 1 Mar 2009 at 2:18

GoogleCodeExporter commented 9 years ago
The implements of groovy involves a lot of classes in the 
org.codehaus.groovy.util
package, and using it sounds overkill to me.

Actually, all we need is just a WeakIdentityHashMap. So, I suggest to use the
implements of cxf:
http://svn.apache.org/repos/asf/cxf/tags/cxf-2.0.6/common/common/src/main/java/o
rg/apache/cxf/common/util/WeakIdentityHashMap.java

Only one class is needed, and we don't need to worry about the license as cxf 
is also
under apache license 2.0.

Original comment by JohnnyJianHY on 4 Mar 2009 at 2:24

GoogleCodeExporter commented 9 years ago

Original comment by JohnnyJianHY on 5 Mar 2009 at 7:46

GoogleCodeExporter commented 9 years ago

Original comment by JohnnyJianHY on 5 Mar 2009 at 8:10