Crash when someone tries to overwrite existing grid cache implementations.

This commit is contained in:
Sebastian Hartte
2020-06-30 20:36:43 +02:00
parent 0a56c724ed
commit 538965e74a
@@ -40,7 +40,7 @@ public final class GridCacheRegistry implements IGridCacheRegistry {
@Nonnull IGridCacheFactory<T> factory) {
if (registry.stream().anyMatch(r -> r.cacheClass.equals(iface))) {
AELog.debug("Overriding grid cache factory for cache type %s", iface);
throw new IllegalArgumentException("Implementation for grid cache "+ iface + " is already registered!");
}
registry.add(new GridCacheRegistration<>(iface, factory));