| Article: |
Memoization in Java Using Dynamic Proxy Classes | |
| Subject: | Methods as Keys | |
| Date: | 2003-08-22 00:08:51 | |
| From: | tomwhite | |
|
Response to: Methods as Keys
|
||
|
Thanks for your comments. It is definitely worth considering garbage collection of classes. As you point out, keeping a "standard" map whose keys are Method objects will prevent the Class instance that owns the method from being garbage collected since a Method has a reference to its owning Class.
|
||
Showing messages 1 through 1 of 1.
-
Methods as Keys
2003-08-22 08:35:05 crazybob [View]



One more note, arrays as method arguments. Rather than using Arrays.asList(), I use a class I wrote called ArrayObject (http://crazybob.org/downloads/ArrayObject.java). Basically, it just implements equals() and hashCode() for arrays. It also compares nested arrays, which is why it works for array arguments.