@GuardedBy("this")
private void storeShard(final DOMDataTreeIdentifier prefix, final ShardRegistration<?> reg) {
- ShardingTableEntry t = shardingTables.get(prefix.getDatastoreType());
- if (t == null) {
- t = new ShardingTableEntry();
- shardingTables.put(prefix.getDatastoreType(), t);
- }
+ ShardingTableEntry t = shardingTables.computeIfAbsent(prefix.getDatastoreType(), k -> new ShardingTableEntry());
t.store(prefix.getRootIdentifier(), reg);
}
// FIXME: wrap the shard in a proper adaptor based on implemented interface
- reg = new ShardRegistration<T>(this, prefix, shard);
+ reg = new ShardRegistration<>(this, prefix, shard);
storeShard(prefix, reg);