Use an ImmutableMap for empty case 19/22419/1
authorRobert Varga <rovarga@cisco.com>
Thu, 11 Jun 2015 22:25:34 +0000 (00:25 +0200)
committerRobert Varga <rovarga@cisco.com>
Thu, 11 Jun 2015 22:25:34 +0000 (00:25 +0200)
Instead of using Collections.emptyMap(), use ImmutableMap.of(). This
will result in an immutable map, taking the immutable shortcut in the
previous check.

Change-Id: I83a58b0dcd5f075d0ac7a7b5073b801ce8a47d08
Signed-off-by: Robert Varga <rovarga@cisco.com>
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/UnmodifiableChildrenMap.java

index 16995208489397e0e353b2909943784501ae4699..f7beffc0bd07a2f685ec6a45082f0474481fab56 100644 (file)
@@ -51,7 +51,7 @@ final class UnmodifiableChildrenMap extends CloneableChildrenMap implements Seri
             return map;
         }
         if (map.isEmpty()) {
-            return Collections.emptyMap();
+            return ImmutableMap.of();
         }
         if (map.size() < WRAP_THRESHOLD) {
             return ImmutableMap.copyOf(map);