Pojomatic statically caches the handler for each Class. This could produce a memory leak in case you run it on a Class in a ClassLoader which is later thrown away.
Using WeakHashMap unfortunately does not help, since values refer to keys, and apparently there is no perfect solution. See my JDK-6389107; probably the best you can do is to hold the value with a SoftReference.
Pojomaticstatically caches the handler for eachClass. This could produce a memory leak in case you run it on aClassin aClassLoaderwhich is later thrown away.Using
WeakHashMapunfortunately does not help, since values refer to keys, and apparently there is no perfect solution. See my JDK-6389107; probably the best you can do is to hold the value with aSoftReference.