FasterXML/java-classmate

Make cache used by `TypeResolver` pluggable; offer concurrent variant in addition to LRU

cowtowncoder opened this issue · 0 comments

Currently TypeResolver uses simple LRU-cache, built on LinkedHashMap.
While that works fine for many use cases there may be cases where highly concurrent, high call rate may lead to concurrency issues (see #40).
Since caching should be easy to make pluggable, let's allow passing of alternate cache implementations for TypeResolver.

In addition to extracting current LRU-based implementation as LRUTypeCache (implementing ResolvedTypeCache which becomes abstract base class), let's also implement simple ConcurrentHashMap-based alternative, ConcurrentTypeCache.