Fix SLING-7586 using SoftReferences and WeakHashMap 9/head
authorPaul Bjorkstrand <paul.bjorkstrand@perficient.com>
Tue, 16 Oct 2018 19:57:54 +0000 (14:57 -0500)
committerPaul Bjorkstrand <paul.bjorkstrand@perficient.com>
Tue, 16 Oct 2018 19:57:54 +0000 (14:57 -0500)
commit5b472557cc6e6057e781a4bf0e65ddfe3d3e8430
tree3487cbd40e9cece084b167c839f83be2421ba655
parent42dccf273623031c34cba9f6289431f90957b9ee
Fix SLING-7586 using SoftReferences and WeakHashMap
Allows the GC to collect cached model instances, even when self-referenced to the original adaptable (e.g. via @Self)
src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
src/test/java/org/apache/sling/models/impl/AdapterFactoryTest.java
src/test/java/org/apache/sling/models/testmodels/classes/CachedModelWithSelfReference.java [new file with mode: 0644]