small bug which we found while test driving Cache2k with JMX enabled in JEE application server.
Version: Running 1.2.1.Final
We want to change the default cache manager name for the current application before any cache is accessed.
Calling CacheManager.setDefaultName early will register the given name.
An UnsupportedOperationException is thrown, coming out of EmptyMap/AbstractMap.put.
Reason: Cache2kCoreProviderImpl initializes loader2defaultName with Collection.emptyMap. This map implementation is immutable and therefore the put modification done in Cache2kCoreProviderImpl.setDefaultManagerName fails.
The field is overwritten with a WeakHashMap as soon as getDefaultManagerName is called but then we're not allowed to change the cache manager name anymore.
Setting the cache manager name via XML works as desired.
The text was updated successfully, but these errors were encountered: