Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Cannot Reproduce
-
3.0.3
-
None
-
None
-
Patch
Description
StringSearchModelInterpolator abuses WeakHashMap; the Field values of fieldsByClass hold hard references to the Class keys, making it useless. Thus if you passed any Class to it, that class and its ClassLoader and the transitive static graph therefrom would never be collectible.
Anyway a cache is unnecessary, since Class does its own caching of fields!
Also removing the ill-conceived fieldIsPrimitiveByClass - not a memory leak, but likely unnecessary complication.
The class is deprecated anyway, but just in case it is used by someone it should be fixed.