You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
small bug which we found while test driving Cache2k with JMX enabled in JEE application server.
Version: Running 1.2.1.Final
Scenario:
We want to change the default cache manager name for the current application before any cache is accessed.
Expectation:
Calling CacheManager.setDefaultName early will register the given name.
Observation:
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.
Workaround:
Setting the cache manager name via XML works as desired.
The text was updated successfully, but these errors were encountered:
@frederikb Many thanks for the detailed bug report!
If that is not critical for anybody I'll plan to fix that on the next feature release but not on the last stable 1.2.x.
Hi,
small bug which we found while test driving Cache2k with JMX enabled in JEE application server.
Version: Running
1.2.1.Final
Scenario:
We want to change the default cache manager name for the current application before any cache is accessed.
Expectation:
Calling
CacheManager.setDefaultName
early will register the given name.Observation:
An
UnsupportedOperationException
is thrown, coming out ofEmptyMap/AbstractMap.put
.Reason:
Cache2kCoreProviderImpl
initializesloader2defaultName
withCollection.emptyMap
. This map implementation is immutable and therefore theput
modification done inCache2kCoreProviderImpl.setDefaultManagerName
fails.The field is overwritten with a
WeakHashMap
as soon asgetDefaultManagerName
is called but then we're not allowed to change the cache manager name anymore.Workaround:
Setting the cache manager name via XML works as desired.
The text was updated successfully, but these errors were encountered: