summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
1bd1474)
ImmutableMap behaves nicely when it meets copying and can
be checked for.
Change-Id: I2e0b52b8ea83c69e4ace3364904975b806a67aae
Signed-off-by: Robert Varga <rovarga@cisco.com>
package org.opendaylight.mdsal.dom.store.inmemory;
import com.google.common.base.Preconditions;
package org.opendaylight.mdsal.dom.store.inmemory;
import com.google.common.base.Preconditions;
-import java.util.Collections;
+import com.google.common.collect.ImmutableMap;
import java.util.Map;
import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteCursor;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
import java.util.Map;
import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteCursor;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
@Override
Map<PathArgument, WriteableModificationNode> getChildrenWithSubshards() {
@Override
Map<PathArgument, WriteableModificationNode> getChildrenWithSubshards() {
- return Collections.emptyMap();
+ return ImmutableMap.of();
import static org.opendaylight.mdsal.dom.store.inmemory.TestUtils.DOM_DATA_TREE_WRITE_CURSOR;
import static org.opendaylight.mdsal.dom.store.inmemory.TestUtils.resetMocks;
import static org.opendaylight.mdsal.dom.store.inmemory.TestUtils.DOM_DATA_TREE_WRITE_CURSOR;
import static org.opendaylight.mdsal.dom.store.inmemory.TestUtils.resetMocks;
-import java.util.Collections;
+import com.google.common.collect.ImmutableMap;
import org.junit.After;
import org.junit.Test;
import org.junit.After;
import org.junit.Test;
WriteableSubshardBoundaryNode.from(FOREIGN_SHARD_MODIFICATION_CONTEXT);
assertNotNull(writeableSubshardBoundaryNode.getChildrenWithSubshards());
WriteableSubshardBoundaryNode.from(FOREIGN_SHARD_MODIFICATION_CONTEXT);
assertNotNull(writeableSubshardBoundaryNode.getChildrenWithSubshards());
- assertSame(Collections.emptyMap(),writeableSubshardBoundaryNode.getChildrenWithSubshards());
+ assertSame(ImmutableMap.of(), writeableSubshardBoundaryNode.getChildrenWithSubshards());
assertEquals(DOM_DATA_TREE_IDENTIFIER.getRootIdentifier().getLastPathArgument(),
writeableSubshardBoundaryNode.getIdentifier());
assertNull(writeableSubshardBoundaryNode.getChild(null));
assertEquals(DOM_DATA_TREE_IDENTIFIER.getRootIdentifier().getLastPathArgument(),
writeableSubshardBoundaryNode.getIdentifier());
assertNull(writeableSubshardBoundaryNode.getChild(null));